#! /bin/bash

#修改apt国内源
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free" > /etc/apt/sources.list
#echo "deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free" >> /etc/apt/sources.list
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free" >> /etc/apt/sources.list
#echo "deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free" >> /etc/apt/sources.list
echo -e "\033[32m 已修改apt源为清华开源镜像站！\033[0m"

echo "deb https://mirrors.bfsu.edu.cn/OpenMediaVault/public/ usul main" > /etc/apt/sources.list.d/openmediavault.list
echo "deb https://mirrors.bfsu.edu.cn/OpenMediaVault/public/ usul-proposed main" >> /etc/apt/sources.list.d/openmediavault.list
echo "deb https://mirrors.bfsu.edu.cn/OpenMediaVault/public/ usul partner" >> /etc/apt/sources.list.d/openmediavault.list
echo -e "\033[32m 已修改OMV软件源为北外开源镜像站！\033[0m"

# echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free" > openmediavault-kernel-backports.list
echo -e "\033[32m 已修改omv kernel-backports源为清华开源镜像站！\033[0m"

#OMV-Extras 扩展源
echo "deb https://mirrors.bfsu.edu.cn/OpenMediaVault/openmediavault-plugin-developers/usul buster main" > /etc/apt/sources.list.d/omvextras.list
echo "deb [arch=amd64] https://download.docker.com/linux/debian buster stable" >> /etc/apt/sources.list.d/omvextras.list
echo "deb http://linux.teamviewer.com/deb stable main" >> /etc/apt/sources.list.d/omvextras.list
echo "deb https://mirrors.bfsu.edu.cn/OpenMediaVault/openmediavault-plugin-developers/usul-testing buster main" >> /etc/apt/sources.list.d/omvextras.list
echo "deb https://mirrors.bfsu.edu.cn/OpenMediaVault/openmediavault-plugin-developers/usul-extras buster main" >> /etc/apt/sources.list.d/omvextras.list
echo -e "\033[32m 已修改OMV-Extras 扩展源为北外开源镜像站！\033[0m"

#apt update更新
apt update -y
#pveupdate
#pveupgrade
echo -e "\033[32m 已完成apt更新！\033[0m"
